package com.cloudbroker.openapi.mobile.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cloudbroker.bcs.common.util.VOUtil;
import com.cloudbroker.bcs.platform.dav.bizapi.service.export.vo.request.GetWeiboAccessTokenForm;
import com.cloudbroker.bcs.platform.dav.bizapi.service.export.vo.response.GetWeiboUserInfoByCodeBackVo;
import com.cloudbroker.bcs.platform.dav.bizapi.t2service.export.WeiboT2BizService;
import com.cloudbroker.bcs.platform.dav.common.ext.annotation.SaveLog;

import static com.cloudbroker.bcs.platform.dav.common.util.RequestUtil.getSingleParameterMapForBody;
@Controller
public class WeiboController {
	@Resource
	private WeiboT2BizService weiboT2;
	
	@ResponseBody
    @RequestMapping("/func_get_weibo_userinfo_by_code")
    @SaveLog(remark = "获取微博用户信息")
	public GetWeiboUserInfoByCodeBackVo getUserinfoByUid(HttpServletRequest request , String jsonpcallback){
		GetWeiboAccessTokenForm form = getSingleParameterMapForBody(request,GetWeiboAccessTokenForm.class);	
		return VOUtil.setJsonpResult(weiboT2.funcGetWeiboUserinfoByCode(form), jsonpcallback);
	}
	
}
